package book;

/**
 * 书放在书架上
 * 和书架相关
 */

public class BookList {
    //书架存放书的最大数量（数组存放书）
    private Book[] books = new Book[10];

    //记录目前实际存放的 书的个数
    private int used;

    public int getUsed() {
        return used;
    }
    public void setUsed(int used) {
        this.used = used;
    }

    //获取书的属性
    public Book getBooks(int pos) {
        return books[pos];
    }
    //设置书的属性
    public void setBooks(int pos, Book book) {
        books[pos] = book;
    }

    //书架上原有书籍
    public BookList() {
        //构造方法，初始化成员
        this.books[0] = new Book("三国演义", "罗贯中", 25.8, "文学著作");
        this.books[1] = new Book("西游记", "吴承恩", 32.6, "文学著作");
        this.books[2] = new Book("水浒传", "施耐庵、罗贯中", 36.4, "文学著作");
        this.books[3] = new Book("红楼梦", "曹雪芹", 28.6, "文学著作");
        this.used = 4;
    }
}
